﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Automobile.service.Model;
using Automobile.service.DAL;
using System.Data;

namespace Automobile.service.BLL
{
    public class MemberCardBLL
    {
        MemberCardDAL dal = new MemberCardDAL();
        /// <summary>
        /// 分页显示会员列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <returns></returns>
        public List<MemberCard> ShowMemberCard(int PageSize, int PageIndex)
        {
            
            return dal.ShowMemberCard(PageSize,PageIndex);
        }
        public int Count()
        {
            return dal.Count();
        }
        /// <summary>
        /// 添加会员
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public int AddMemberCard(MemberCard m)
        {
            return dal.AddMemberCard(m);
        }
        /// <summary>
        /// 根据id获取单条信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataTable GetMemberById(int id)
        {
            return dal.GetMemberById(id);
        }
        /// <summary>
        /// 修改会员
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public int Upd(MemberCard m)
        {
            return dal.Upd(m);
        }
        /// <summary>
        /// 删除会员
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Del(int id)
        {
            return dal.Del(id);
        }
        /// <summary>
        /// 查询会员列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <returns></returns>
        public List<MemberCard> ShowMemberCard_Sel(int PageSize, int PageIndex, string MemberCard_owner, string MemberCard_Name)
        {
            return dal.ShowMemberCard_Sel(PageSize, PageIndex, MemberCard_owner, MemberCard_Name);
        }
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="MemberCard_State"></param>
        /// <param name="MemberCard_Id"></param>
        /// <returns></returns>
        public int UptState(int MemberCard_State, int MemberCard_Id)
        {
            return dal.UptState(MemberCard_State,MemberCard_Id);
        }
        public int count()
        {
            return dal.count();
        } 
    }
}
